//@author A0100617W
#pragma once
#ifndef TIMEPARSER_H                    
#define TIMEPARSER_H
#include <string>
#include <regex>
#include <iostream>
#include <sstream>

const std::regex ampm("((?:(?:[0-9][0-9])|(?:[0-9]))(?:[\\s]*?(?:am|AM|pm|PM|Am|pM|aM|Pm)))");
const std::regex column_ampm("((?:(?:[0-9][0-9])|(?:[0-9]))[\\s]*:[\\s]*(?:[0-9][0-9]|(?:[0-9]))(?:[\\s]*?(?:am|AM|pm|PM|Am|pM|aM|Pm)))");
const std::regex column("(?:(?:[0-9][0-9])|(?:[0-9]))[\\s]*:[\\s]*(?:[0-9][0-9]|(?:[0-9]))");
const std::regex num_num("((?:(?:[0-9][0-9])|(?:[0-9]))(?:\\s*)?[\\-\\~](?:\\s*)?(?:[0-9][0-9]|(?:[0-9])))");


const std:: string NOT_FOUND_STRING = " \",./?';:][{}\\|<>=+-_)(*&^%$#@!~`";
const std:: string QUOTE="";
const std:: string COLON1=":";
const std:: string ZERO_STRING = "0";
const std:: string DOUBLE_ZERO = "00";
const std:: string COLON_ZERO = ":0";
const std:: string COLON_DOUBLE_ZERO = ":00";



class TimeParser
{
private:
	std::string clear_Space_Punctuation(std::string);
	bool checkHour24(int);
	bool checkHour12(int);
	bool checkMin(int);
	std::string correctTime(std::string);
	std::string getStandardTimeString_ampm(std::string);
	std::string getStandardTimeString_column_ampm(std::string);
	std::string getStandardTimeString_column(std::string);
public:
	bool parse(std::string, std::string&, size_t&, size_t&);
	bool parseTwoTime(std::string, std::string&, std::string&, size_t&, size_t&);
	TimeParser(void);
	~TimeParser(void);
};

#endif

